//
//  SMHMineProductSectionView.swift
//  SMHCommerce
//
//  Created by lvzhao on 2020/6/4.
//  Copyright © 2020 lvzhao. All rights reserved.
//

import UIKit

class SMHMineProductSectionView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.setupUI()
    }
    

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    //MARK:setupUI
    func setupUI() {
        let sectionLab = UILabel()
        sectionLab.text = "我的商品"
        sectionLab.font = ktextBoldFont(size: 15)
        sectionLab.textColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(sectionLab)
        let sectionWidth = sectionLab.text!.lz_widthWithString(font: sectionLab.font, height: 15)
        sectionLab.snp.makeConstraints { (make) in
            make.width.equalTo(Int(sectionWidth))
            make.centerY.equalTo(self.snp.centerY)
            make.height.equalTo(15)
            make.centerX.equalTo(self.snp.centerX)
        }
        
        
        let rightView = UIView()
        rightView.backgroundColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(rightView)
        rightView.snp.makeConstraints { (make) in
            make.left.equalTo(sectionLab.snp.left).offset(-15)
            make.centerY.equalTo(self.snp.centerY)
            make.width.height.equalTo(6)
        }
        rightView.clipRectCorner(direction: .allCorners, cornerRadius: 3)
        
        
        let leftView = UIView()
        leftView.backgroundColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(leftView)
        leftView.snp.makeConstraints { (make) in
            make.left.equalTo(sectionLab.snp.right).offset(15)
            make.centerY.equalTo(self.snp.centerY)
            make.width.height.equalTo(6)
        }
        leftView.clipRectCorner(direction: .allCorners, cornerRadius: 3)
    }

}
